<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right"><a href="<?php echo $add; ?>" data-toggle="tooltip" title="<?php echo $button_add; ?>" class="btn btn-primary"><i class="fa fa-plus"></i></a> <a href="<?php echo $repair; ?>" data-toggle="tooltip" title="<?php echo $button_rebuild; ?>" class="btn btn-default"><i class="fa fa-refresh"></i></a>
        <!-- <button type="button" data-toggle="tooltip" title="<?php echo $button_delete; ?>" class="btn btn-danger" onclick="confirm('<?php echo $text_confirm; ?>') ? $('#form-category').submit() : false;"><i class="fa fa-trash-o"></i></button> -->
      </div>
      <h1><?php echo $heading_title; ?></h1>
      <ul class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
        <?php } ?>
      </ul>
    </div>
  </div>
  <div class="container-fluid">
<<<<<<< HEAD
<<<<<<< HEAD
=======
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
     <?php if ($projects) { ?>
                <?php foreach ($projects as $project) { ?>
                  <?php if(!empty($project['ckg_number_msg']) && $project['ckg_number_msg'] == 1){ ?>
                  <div class="alert alert-success"><i class="fa fa-exclamation-circle"></i> <?php echo '請填寫“'.$project['project_name'].'”'.$column_ckg_number; ?>
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                  </div>
                  <?php } ?>
                <?php } ?>
    <?php } ?>
<<<<<<< HEAD
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
    <?php if ($error_warning) { ?>
    <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <?php if ($success) { ?>
    <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-list"></i> <?php echo $text_list; ?></h3>
      </div>
      <div class="panel-body">
        <div class="well">
          <div class="row">
            <div class="col-sm-4">
              <div class="form-group">
<<<<<<< HEAD
<<<<<<< HEAD
                <label class="control-label" for="input-customer_name"><?php echo $column_customer_name; ?></label>
                <input type="text" name="filter_customer_name" value="<?php echo $filter_customer_name; ?>" placeholder="<?php echo $column_customer_name; ?>" id="input-customer_name" class="form-control" />
              </div>
              <div class="form-group">
                <label class="control-label" for="input-bank"><?php echo $column_bank; ?></label>
                <input type="text" name="filter_bank" value="<?php echo $filter_bank; ?>" placeholder="<?php echo $column_bank; ?>" id="input-bank" class="form-control" />
=======
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                <label class="control-label" for="input-ckg_number"><?php echo $column_ckg_number; ?></label>
                <input type="text" name="filter_ckg_number" value="<?php echo $filter_ckg_number; ?>" placeholder="<?php echo $column_ckg_number; ?>" id="input-ckg_number" class="form-control" />
              </div>
              <div class="form-group">
                <label class="control-label" for="input-status"><?php echo $column_project_customer_search; ?></label>
                <div style="display: flex;">
                  <input type="text" name="filter_customer_value" class="form-control" value="<?php echo $filter_customer_value; ?>" >
                  <select name="filter_customer_name" id="input-filter_customer_name" class="form-control" style="width: auto;">
                    <option value="company_eng_name" <?php if($filter_customer_name == 'company_eng_name'){ echo 'selected'; } ?> >Company ENG. Name</option>
                    <option value="company_chn_name" <?php if($filter_customer_name == 'company_chn_name'){ echo 'selected'; } ?> >Company CHN. Name</option>
                    <option value="contact_person_eng_name" <?php if($filter_customer_name == 'contact_person_eng_name'){ echo 'selected'; } ?> >Contact Person ENG. Name</option>
                    <option value="contact_person_chn_name" <?php if($filter_customer_name == 'contact_person_chn_name'){ echo 'selected'; } ?> >Contact Person CHN. Name</option>
                    <option value="contact_person_tel" <?php if($filter_customer_name == 'contact_person_tel'){ echo 'selected'; } ?> >Contact Person Tel</option>
                    <option value="contact_person_email" <?php if($filter_customer_name == 'contact_person_email'){ echo 'selected'; } ?> >Contact Person Email</option>
                  </select>
                </div>
<<<<<<< HEAD
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
<<<<<<< HEAD
<<<<<<< HEAD
                <label class="control-label" for="input-admin_name"><?php echo $column_admin_name; ?></label>
                <input type="text" name="filter_admin_name" value="<?php echo $filter_admin_name; ?>" placeholder="<?php echo $column_admin_name; ?>" id="input-admin_name" class="form-control" />
              </div>
              <div class="form-group">
                <label class="control-label" for="input-admin_tel"><?php echo $column_admin_tel; ?></label>
                <input type="text" name="filter_admin_tel" value="<?php echo $filter_admin_tel; ?>" placeholder="<?php echo $column_admin_tel; ?>" id="input-admin_tel" class="form-control" />
=======
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                <label class="control-label" for="input-project_name"><?php echo $column_project_name; ?></label>
                <input type="text" name="filter_project_name" value="<?php echo $filter_project_name; ?>" placeholder="<?php echo $column_project_name; ?>" id="input-project_name" class="form-control" />
              </div>
              <div class="form-group">
                <label class="control-label" for="input-english_name_of_supplier"><?php echo $column_vendor_1; ?></label>
                <input type="text" name="filter_english_name_of_supplier" value="<?php echo $filter_english_name_of_supplier; ?>" placeholder="<?php echo $column_vendor_1; ?>" id="input-english_name_of_supplier" class="form-control" />
<<<<<<< HEAD
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="control-label" for="input-status"><?php echo $column_status; ?></label>
                <select name="filter_status" id="input-status" class="form-control">
<<<<<<< HEAD
<<<<<<< HEAD
                  <option value="*"></option>
                  <?php if ($filter_status) { ?>
                    <?php foreach($wechat_status as $key => $statu){ ?>
                      <option value="<?php echo $key; ?>" <?php if($filter_status == $key){ echo 'selected'; } ?> ><?php echo $statu; ?></option>
                    <?php } ?>
                  <?php }else{ ?>
                    <?php foreach($wechat_status as $key => $statu){ ?>
                      <option value="<?php echo $key; ?>" ><?php echo $statu; ?></option>
=======
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                  <option value="*">Default</option>
                  <option value="all" <?php if($filter_status == 'all'){ echo 'selected'; } ?> >ALL</option>
                  <?php if ($filter_status) { ?>
                    <?php foreach($status_all as $statu){ ?>
                      <option value="<?php echo $statu['project_status_id']; ?>" <?php if($filter_status == $statu['project_status_id']){ echo 'selected'; } ?> ><?php echo $statu['name']; ?></option>
                    <?php } ?>
                  <?php }else{ ?>
                    <?php foreach($status_all as $statu){ ?>
                      <option value="<?php echo $statu['project_status_id']; ?>" ><?php echo $statu['name']; ?></option>
<<<<<<< HEAD
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                    <?php } ?>
                  <?php } ?>
                </select>
              </div>
              <button type="button" id="button-filter" class="btn btn-primary pull-right"><i class="fa fa-search"></i> <?php echo $button_filter; ?></button>
            </div>
          </div>
        </div>
        <div class="row">
          <div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
          <div class="col-sm-6 text-right"><?php echo $results; ?></div>
        </div>
        <form action="<?php echo $delete; ?>" method="post" enctype="multipart/form-data" id="form-category">
          <div class="table-responsive">
            <table class="table table-bordered table-hover" style="vertical-align: top;">
              <thead style="background-color: #f5f5f5;">
                <tr>
<<<<<<< HEAD
<<<<<<< HEAD
                  <td style="width: 1px;" class="text-center"><?php echo $text_num; ?></td>
=======
                  <td style="width: 1px;" class="text-center">序號</td>
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
                  <td style="width: 1px;" class="text-center">序號</td>
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                  <!-- <td class="text-center"><?php echo $column_action; ?></td> -->
                  <td class="text-center">
                    <?php if ($sort == 'status') { ?>
                    <a href="<?php echo $sort_status; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_status; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_status; ?>"><?php echo $column_status; ?></a>
                    <?php } ?>

                  </td>
<<<<<<< HEAD
<<<<<<< HEAD
                  <td class="text-center"><?php echo $column_customer_name; ?></td>
                  <td class="text-center"><?php echo $column_admin_name; ?></td>
                  <td class="text-center"><?php echo $column_admin_email; ?></td>
                  <td class="text-center"><?php echo $column_admin_tel; ?></td>
                  <td class="text-center"><?php echo $column_company_bank_account_name; ?></td>
                  <td class="text-center"><?php echo $column_company_bank_account_num; ?></td>
                  <td class="text-center"><?php echo $column_bank; ?></td>
                  <td class="text-center"><?php echo $column_wechat_login_name; ?></td>
                  <td class="text-center"><?php echo $column_wechat_login_password; ?></td>
                  <td class="text-center"><?php echo $column_no_1; ?></td>
                  <td class="text-center"><?php echo $column_no_2; ?></td>
                  <td class="text-center"><?php echo $column_no_3; ?></td>
                  <td class="text-center"><?php echo $column_no_4; ?></td>
                  <td class="text-center"><?php echo $column_no_5; ?></td>
                </tr>
              </thead>
              <tbody>
                <?php if (isset($wechats) && $wechats) { ?>
                <?php foreach ($wechats as $key => $wechat) { ?>
                <tr>
                  <td class="text-center"><?php echo $key+1; ?></td>

                  <td class="text-center"><?php echo $wechat['status']; ?></td>
                  <td class="text-center"><a href="<?php echo $wechat['edit']; ?>" ><?php echo $wechat['customer_name']; ?></a></td>
                  <td class="text-center"><?php echo $wechat['admin_name']; ?></td>
                  <td class="text-center"><?php echo $wechat['admin_email']; ?></td>
                  <td class="text-center"><?php echo $wechat['admin_tel']; ?></td>
                  <td class="text-center"><?php echo $wechat['company_bank_account_name']; ?></td>
                  <td class="text-center"><?php echo $wechat['company_bank_account_num']; ?></td>
                  <td class="text-center"><?php echo $wechat['bank']; ?></td>
                  <td class="text-center"><?php echo $wechat['wechat_login_name']; ?></td>
                  <td class="text-center"><?php echo $wechat['wechat_login_password']; ?></td>


                  <td class="text-center" <?php if($wechat['no_1'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($wechat['no_1_url']){ echo 'href="'.HTTP_CATALOG.$wechat['no_1_url'].'"';} ?> title="<?php echo $wechat['no_1_name']; ?>" ><?php echo $wechat['no_1']; ?></a></td>
                  <td class="text-center" <?php if($wechat['no_2'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($wechat['no_2_url']){ echo 'href="'.HTTP_CATALOG.$wechat['no_2_url'].'"';} ?> title="<?php echo $wechat['no_2_name']; ?>" ><?php echo $wechat['no_2']; ?></a></td>
                  <td class="text-center" <?php if($wechat['no_3'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($wechat['no_3_url']){ echo 'href="'.HTTP_CATALOG.$wechat['no_3_url'].'"';} ?> title="<?php echo $wechat['no_3_name']; ?>" ><?php echo $wechat['no_3']; ?></a></td>
                  <td class="text-center" <?php if($wechat['no_4'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($wechat['no_4_url']){ echo 'href="'.HTTP_CATALOG.$wechat['no_4_url'].'"';} ?> title="<?php echo $wechat['no_4_name']; ?>" ><?php echo $wechat['no_4']; ?></a></td>
                  <td class="text-center" <?php if($wechat['no_5'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($wechat['no_5_url']){ echo 'href="'.HTTP_CATALOG.$wechat['no_5_url'].'"';} ?> title="<?php echo $wechat['no_5_name']; ?>" ><?php echo $wechat['no_5']; ?></a></td>
=======
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                  <td class="text-center"><?php echo $column_project_customer; ?></td>
                  <td class="text-center"><?php echo $column_vendor_1; ?></td>
                  <td class="text-center"><?php echo $column_vendor_2; ?></td>
                  <td class="text-center"><?php echo $column_vendor_3; ?></td>
                  <td class="text-center"><?php echo $column_no_1; ?></td>
                  <td class="text-center"><?php echo $column_no_5; ?></td>
                  <td class="text-center"><?php echo $column_no_6; ?></td>
                  <td class="text-center"><?php echo $column_no_7; ?></td>
                  <td class="text-center"><?php echo $column_no_8; ?></td>
                  <td class="text-center"><?php echo $column_no_9; ?></td>
                  <td class="text-center"><?php echo $column_no_10; ?></td>
                  <td class="text-center"><?php echo $column_no_11; ?></td>
                  <td class="text-center"><?php echo $column_no_12; ?></td>
                  <td class="text-center"><?php echo $column_no_13; ?></td>
                  <td class="text-center"><?php echo $column_no_14; ?></td>
                  <!-- <td class="text-center"><?php echo $column_no_15; ?></td> -->
<!--                   <td class="text-center"><?php echo $column_no_16; ?></td> -->
                  <td class="text-center"><?php echo $column_no_17; ?></td>
                  <td class="text-center"><?php echo $column_confirm; ?></td>
                  <td class="text-center"><?php echo $column_no_2; ?></td>
                  <td class="text-center"><?php echo $column_no_3; ?></td>
                  <td class="text-center"><?php echo $column_no_4; ?></td>
                  <td class="text-center"><?php echo $column_follow_up_history; ?></td>
                  <!-- <td class="text-center"><?php echo $column_remark; ?></td> -->
                  <td class="text-center">
                    <?php if ($sort == 'ckg_number') { ?>
                    <a href="<?php echo $sort_ckg_number; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_ckg_number; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_ckg_number; ?>"><?php echo $column_ckg_number; ?></a>
                    <?php } ?>
                  </td>
                  <td class="text-center">
                    <?php if ($sort == 'project_name') { ?>
                    <a href="<?php echo $sort_project_name; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_project_name; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_project_name; ?>"><?php echo $column_project_name; ?></a>
                    <?php } ?>
                  </td>
                </tr>
              </thead>
              <tbody>
                <?php if ($projects) { ?>
                <?php foreach ($projects as $key => $project) { ?>
                <tr>
                  <td class="text-center"><?php echo $key+1; ?></td>
                  <!-- <td class="text-center"><a href="<?php echo $project['edit']; ?>" data-toggle="tooltip" title="<?php echo $button_edit; ?>" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td> -->
                   <!-- <?php if($project['status'] == 0){ ?>
                    <td class="text-center" style="color: white;background-color: #ff0000;"><?php echo $text_status_0; ?></td>
                  <?php }else if($project['status'] == 1){ ?>
                    <td class="text-center" style="color: white;background-color: #f90;"><?php echo $text_status_1; ?></td>
                  <?php }else if($project['status'] == 2){ ?>
                    <td class="text-center" style="color: white;background-color: #f7ef01;"><?php echo $text_status_2; ?></td>
                  <?php }else if($project['status'] == 3){ ?>
                    <td class="text-center" style="color: white;background-color: #56ff00;"><?php echo $text_status_3; ?></td>
                  <?php }else if($project['status'] == 4){ ?>
                    <td class="text-center" style="color: white;background-color: green;"><?php echo $text_status_4; ?></td>
                  <?php } ?> -->
                  <td class="text-center" style="color: white;background-color: <?php echo $project['status']['color']; ?>;"><?php echo $project['status']['name']; ?></td>
                  <td class="text-center"><a href="<?php echo $project['edit']; ?>" ><?php echo $project['project_customer']; ?></a></td>
                  <td class="text-center"><a target="_blank" href="<?php echo $project['vendor_edit_1']; ?>" ><?php echo $project['vendor_1']; ?></a></td>
                  <td class="text-center"><a target="_blank" href="<?php echo $project['vendor_edit_2']; ?>" ><?php echo $project['vendor_2']; ?></a></td>
                  <td class="text-center"><a target="_blank" href="<?php echo $project['vendor_edit_3']; ?>" ><?php echo $project['vendor_3']; ?></a></td>
                  <td class="text-center" <?php if($project['no_1'] == 'Y'){ echo "style='background-color: green;'"; }else{ echo "style='background-color: red;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_1_url']){ echo 'href="'.HTTP_CATALOG.$project['no_1_url'].'"';} ?> title="<?php echo $project['no_1_name']; ?>" ><?php echo $project['no_1']; ?></a></td>
                  <td class="text-center" <?php if($project['no_5'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_5_url']){ echo 'href="'.HTTP_CATALOG.$project['no_5_url'].'"';} ?> title="<?php echo $project['no_5_name']; ?>" ><?php echo $project['no_5']; ?></a></td>
                  <td class="text-center" <?php if($project['no_6'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_6_url']){ echo 'href="'.HTTP_CATALOG.$project['no_6_url'].'"';} ?> title="<?php echo $project['no_6_name']; ?>" ><?php echo $project['no_6']; ?></a></td>
                  <td class="text-center" <?php if($project['no_7'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_7_url']){ echo 'href="'.HTTP_CATALOG.$project['no_7_url'].'"';} ?> title="<?php echo $project['no_7_name']; ?>" ><?php echo $project['no_7']; ?></a></td>
                  <td class="text-center" <?php if($project['no_8'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_8_url']){ echo 'href="'.HTTP_CATALOG.$project['no_8_url'].'"';} ?> title="<?php echo $project['no_8_name']; ?>" ><?php echo $project['no_8']; ?></a></td>
                  <td class="text-center" <?php if($project['no_9'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_9_url']){ echo 'href="'.HTTP_CATALOG.$project['no_9_url'].'"';} ?> title="<?php echo $project['no_9_name']; ?>" ><?php echo $project['no_9']; ?></a></td>
                  <td class="text-center" <?php if($project['no_10'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_10_url']){ echo 'href="'.HTTP_CATALOG.$project['no_10_url'].'"';} ?> title="<?php echo $project['no_10_name']; ?>" ><?php echo $project['no_10']; ?></a></td>
                  <td class="text-center" <?php if($project['no_11'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_11_url']){ echo 'href="'.HTTP_CATALOG.$project['no_11_url'].'"';} ?> title="<?php echo $project['no_11_name']; ?>" ><?php echo $project['no_11']; ?></a></td>
                  <td class="text-center" <?php if($project['no_12'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_12_url']){ echo 'href="'.HTTP_CATALOG.$project['no_12_url'].'"';} ?> title="<?php echo $project['no_12_name']; ?>" ><?php echo $project['no_12']; ?></a></td>
                  <td class="text-center" <?php if($project['no_13'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_13_url']){ echo 'href="'.HTTP_CATALOG.$project['no_13_url'].'"';} ?> title="<?php echo $project['no_13_name']; ?>" ><?php echo $project['no_13']; ?></a></td>
                  <td class="text-center" <?php if($project['no_14'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_14_url']){ echo 'href="'.HTTP_CATALOG.$project['no_14_url'].'"';} ?> title="<?php echo $project['no_14_name']; ?>" ><?php echo $project['no_14']; ?></a></td>
                  <!-- <td class="text-center" <?php if($project['no_15'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_15_url']){ echo 'href="'.HTTP_CATALOG.$project['no_15_url'].'"';} ?> title="<?php echo $project['no_15_name']; ?>" ><?php echo $project['no_15']; ?></a></td> -->
<!--                   <td class="text-center" <?php if($project['no_16'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_16_url']){ echo 'href="'.HTTP_CATALOG.$project['no_16_url'].'"';} ?> title="<?php echo $project['no_16_name']; ?>" ><?php echo $project['no_16']; ?></a></td> -->
                  <td class="text-center" <?php if($project['no_17'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> ><a target='_blank' style='color:white;display: block;height: 100%;' <?php if($project['no_17_url']){ echo 'href="'.HTTP_CATALOG.$project['no_17_url'].'"';} ?> title="<?php echo $project['no_17_name']; ?>" ><?php echo $project['no_17']; ?></a></td>
                  <td class="text-center" <?php if($project['confirm'] == 'Y'){ echo "style='background-color: green;color:white;'"; }else{ echo "style='background-color: red;color:white;'"; } ?> >
                    <?php echo $project['confirm']; ?>
                  </td>
                  <td class="text-center" ><?php echo $project['no_2']; ?></td>
                  <td class="text-center"><?php echo $project['no_3']; ?></td>
                  <td class="text-center"><?php echo $project['no_4']; ?></td>
                  <!-- <td class="text-center"><?php echo $project['remark']; ?></td> -->
                  <td class="text-center"><?php echo $project['follow_up_history']; ?></td>
                  <td class="text-center"><?php echo $project['ckg_number']; ?></td>
                  <td class="text-center"><?php echo $project['project_name']; ?></td>
<<<<<<< HEAD
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                </tr>
                <?php } ?>
                <?php } else { ?>
                <tr>
<<<<<<< HEAD
<<<<<<< HEAD
                  <td class="text-center" colspan="16"><?php echo $text_no_results; ?></td>
=======
                  <td class="text-center" colspan="4"><?php echo $text_no_results; ?></td>
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
                  <td class="text-center" colspan="4"><?php echo $text_no_results; ?></td>
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                </tr>
                <?php } ?>
              </tbody>
              <tfoot style="background-color: #f5f5f5;font-weight: bold;">
                <tr>
<<<<<<< HEAD
<<<<<<< HEAD
                  <td style="width: 1px;" class="text-center"><?php echo $text_num; ?></td>
=======
                  <td style="width: 1px;" class="text-center">序號</td>
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
                  <td style="width: 1px;" class="text-center">序號</td>
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                  <!-- <td class="text-center"><?php echo $column_action; ?></td> -->
                  <td class="text-center">
                    <?php if ($sort == 'status') { ?>
                    <a href="<?php echo $sort_status; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_status; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_status; ?>"><?php echo $column_status; ?></a>
                    <?php } ?>

                  </td>
<<<<<<< HEAD
<<<<<<< HEAD
                  <td class="text-center"><?php echo $column_customer_name; ?></td>
                  <td class="text-center"><?php echo $column_admin_name; ?></td>
                  <td class="text-center"><?php echo $column_admin_email; ?></td>
                  <td class="text-center"><?php echo $column_admin_tel; ?></td>
                  <td class="text-center"><?php echo $column_company_bank_account_name; ?></td>
                  <td class="text-center"><?php echo $column_company_bank_account_num; ?></td>
                  <td class="text-center"><?php echo $column_bank; ?></td>
                  <td class="text-center"><?php echo $column_wechat_login_name; ?></td>
                  <td class="text-center"><?php echo $column_wechat_login_password; ?></td>
                  <td class="text-center"><?php echo $column_no_1; ?></td>
                  <td class="text-center"><?php echo $column_no_2; ?></td>
                  <td class="text-center"><?php echo $column_no_3; ?></td>
                  <td class="text-center"><?php echo $column_no_4; ?></td>
                  <td class="text-center"><?php echo $column_no_5; ?></td>
=======
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                  <td class="text-center"><?php echo $column_project_customer; ?></td>
                  <td class="text-center"><?php echo $column_vendor_1; ?></td>
                  <td class="text-center"><?php echo $column_vendor_2; ?></td>
                  <td class="text-center"><?php echo $column_vendor_3; ?></td>
                  <td class="text-center"><?php echo $column_no_1; ?></td>
                  <td class="text-center"><?php echo $column_no_5; ?></td>
                  <td class="text-center"><?php echo $column_no_6; ?></td>
                  <td class="text-center"><?php echo $column_no_7; ?></td>
                  <td class="text-center"><?php echo $column_no_8; ?></td>
                  <td class="text-center"><?php echo $column_no_9; ?></td>
                  <td class="text-center"><?php echo $column_no_10; ?></td>
                  <td class="text-center"><?php echo $column_no_11; ?></td>
                  <td class="text-center"><?php echo $column_no_12; ?></td>
                  <td class="text-center"><?php echo $column_no_13; ?></td>
                  <td class="text-center"><?php echo $column_no_14; ?></td>
                  <!-- <td class="text-center"><?php echo $column_no_15; ?></td> -->
<!--                   <td class="text-center"><?php echo $column_no_16; ?></td> -->
                  <td class="text-center"><?php echo $column_confirm; ?></td>
                  <td class="text-center"><?php echo $column_no_17; ?></td>
                  <td class="text-center"><?php echo $column_no_2; ?></td>
                  <td class="text-center"><?php echo $column_no_3; ?></td>
                  <td class="text-center"><?php echo $column_no_4; ?></td>
                  <td class="text-center"><?php echo $column_follow_up_history; ?></td>
                  <!-- <td class="text-center"><?php echo $column_remark; ?></td> -->
                  <td class="text-center">
                    <?php if ($sort == 'ckg_number') { ?>
                    <a href="<?php echo $sort_ckg_number; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_ckg_number; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_ckg_number; ?>"><?php echo $column_ckg_number; ?></a>
                    <?php } ?>
                  </td>
                  <td class="text-center">
                    <?php if ($sort == 'project_name') { ?>
                    <a href="<?php echo $sort_project_name; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_project_name; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_project_name; ?>"><?php echo $column_project_name; ?></a>
                    <?php } ?>
                  </td>
<<<<<<< HEAD
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                </tr>
              </tfoot>
            </table>
          </div>
        </form>
        <div class="row">
          <div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
          <div class="col-sm-6 text-right"><?php echo $results; ?></div>
        </div>
      </div>
    </div>
  </div>
</div>
  <script type="text/javascript"><!--
$('#button-filter').on('click', function() {
<<<<<<< HEAD
<<<<<<< HEAD
  var url = 'index.php?route=hk/wechat_foreign&token=<?php echo $token; ?>';

  var filter_customer_name = $('input[name=\'filter_customer_name\']').val();

  if (filter_customer_name) {
    url += '&filter_customer_name=' + encodeURIComponent(filter_customer_name);
  }

  var filter_admin_tel = $('input[name=\'filter_admin_tel\']').val();

  if (filter_admin_tel) {
    url += '&filter_admin_tel=' + encodeURIComponent(filter_admin_tel);
  }

  var filter_admin_name = $('input[name=\'filter_admin_name\']').val();

  if (filter_admin_name) {
    url += '&filter_admin_name=' + encodeURIComponent(filter_admin_name);
  }

  var filter_bank = $('input[name=\'filter_bank\']').val();

  if (filter_bank) {
    url += '&filter_bank=' + encodeURIComponent(filter_bank);
  }
=======
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
  var url = 'index.php?route=project/project_progress&token=<?php echo $token; ?>';

  var filter_ckg_number = $('input[name=\'filter_ckg_number\']').val();

  if (filter_ckg_number) {
    url += '&filter_ckg_number=' + encodeURIComponent(filter_ckg_number);
  }

  var filter_project_name = $('input[name=\'filter_project_name\']').val();

  if (filter_project_name) {
    url += '&filter_project_name=' + encodeURIComponent(filter_project_name);
  }
  var filter_english_name_of_supplier = $('input[name=\'filter_english_name_of_supplier\']').val();

  if (filter_english_name_of_supplier) {
    url += '&filter_english_name_of_supplier=' + encodeURIComponent(filter_english_name_of_supplier);
  }

<<<<<<< HEAD
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
  var filter_status = $('select[name=\'filter_status\']').val();

  if (filter_status != '*') {
    url += '&filter_status=' + encodeURIComponent(filter_status);
  }


<<<<<<< HEAD
<<<<<<< HEAD
  // var filter_customer_name = $('select[name=\'filter_customer_name\']').val();

  // var filter_customer_value = $('input[name=\'filter_customer_value\']').val();
  // console.log(filter_english_name_of_supplier);

  // if (filter_customer_value){
  //   if(filter_customer_name){

  //   url += '&filter_customer_value=' + encodeURIComponent(filter_customer_value);

  //   url += '&filter_customer_name=' + encodeURIComponent(filter_customer_name);
      
  //   } 
  // }
=======
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
  var filter_customer_name = $('select[name=\'filter_customer_name\']').val();

  var filter_customer_value = $('input[name=\'filter_customer_value\']').val();
  console.log(filter_english_name_of_supplier);

  if (filter_customer_value){
    if(filter_customer_name){

    url += '&filter_customer_value=' + encodeURIComponent(filter_customer_value);

    url += '&filter_customer_name=' + encodeURIComponent(filter_customer_name);
      
    } 
  }
<<<<<<< HEAD
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa

  location = url;
});
//--></script>
  <script type="text/javascript"><!--
$('input[name=\'filter_ckg_number\']').autocomplete({
  'source': function(request, response) {
    $.ajax({
      url: 'index.php?route=project/project_progress/autocomplete&token=<?php echo $token; ?>&filter_ckg_number=' +  encodeURIComponent(request),
      dataType: 'json',
      success: function(json) {
        response($.map(json, function(item) {
          return {
            label: item['ckg_number'],
            value: item['ckg_number']
          }
        }));
      }
    });
  },
  'select': function(item) {
    $('input[name=\'filter_ckg_number\']').val(item['label']);
  }
});

$('input[name=\'filter_project_name\']').autocomplete({
  'source': function(request, response) {
    $.ajax({
      url: 'index.php?route=project/project_progress/autocomplete&token=<?php echo $token; ?>&filter_project_name=' +  encodeURIComponent(request),
      dataType: 'json',
      success: function(json) {
        response($.map(json, function(item) {
          return {
            label: item['project_name'],
            value: item['project_name']
          }
        }));
      }
    });
  },
  'select': function(item) {
    $('input[name=\'filter_project_name\']').val(item['label']);
  }
});
$('input[name=\'filter_english_name_of_supplier\']').autocomplete({
  'source': function(request, response) {
    $.ajax({
      url: 'index.php?route=project/project_progress/autocomplete3&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request),
      dataType: 'json',
      success: function(json) {
        response($.map(json, function(item) {
          return {
            label: item['name'],
            value: item['name']
          }
        }));
      }
    });
  },
  'select': function(item) {
    $('input[name=\'filter_english_name_of_supplier\']').val(item['label']);
  }
});
//--></script>
<?php echo $footer; ?>